﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="P_GenerateFile.aspx.cs"
    MasterPageFile="~/Popup.Master" Inherits="SAP.P_GenerateFile" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" src="../../js/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="../../js/main.js"></script>
    <script type="text/javascript">
        function RefreshUpdatePanel() {

        };

        function PopupPrint() {
            <%Session["DocumentType"] = "PO"; %> 
            var url = "rptViewer.aspx?type=PO&GeneralID=" + document.getElementById('hf_GeneralID').value;
            window.open(url, '_self');
        };

    </script>
    <div>
        <asp:UpdatePanel ID="editItemUpdatePanel" runat="server" UpdateMode="Conditional"
            ChildrenAsTriggers="True">
            <ContentTemplate>
                <span class="style1">WSC Text Generation:</span><br />
                <table border="0" width="100%">
                    <tr>
                        <td style="width: 50%">
                            <table border="0" width="100%" style="background-color: #C9DBF2;">
                                <tr>
                                    <td class="FormLineItemAlt" style="width: 10%">
                                        From Date:
                                    </td>
                                    <td class="FormLineItemAlt" style="width: 35%">
                                        <asp:TextBox ID="txtFromDate" runat="server" Width="30%" Enabled="False"></asp:TextBox>
                                        <asp:ImageButton ID="ImageButton1" runat="Server" AlternateText="Click to show calendar"
                                            ImageUrl="~/Images/Calendar_scheduleHS.png" />
                                        <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtFromDate"
                                            PopupButtonID="ImageButton1" Format="dd/MM/yyyy">
                                        </cc1:CalendarExtender>
                                        ToDate:
                                        <asp:TextBox ID="txtToDate" runat="server" Width="30%" Enabled="False"></asp:TextBox>
                                        <asp:ImageButton ID="ImageButton2" runat="Server" AlternateText="Click to show calendar"
                                            ImageUrl="~/Images/Calendar_scheduleHS.png" />
                                    </td>
                                    <td class="FormLineItemAlt" style="width: 10%">
                                        Dealer:</td>
                                    <td class="FormLineItemAlt" style="width: 35%">
                                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtToDate"
                                            PopupButtonID="ImageButton2" Format="dd/MM/yyyy">
                                        </cc1:CalendarExtender>
                                        &nbsp;<asp:DropDownList ID="ddl_Dealer" runat="server" Width="75%">
                                        </asp:DropDownList>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="FormLineItemAlt" style="width: 10%">
                                        WSC Text File</td>
                                    <td class="FormLineItemAlt" colspan="3" rowspan="7">
                                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                        <asp:TextBox ID="txt_GeneratedText" runat="server" Height="200px" 
                                            TextMode="MultiLine" Width="90%" EnableTheming="False"></asp:TextBox>
                                    </td>
                                </tr>

                                <tr>
                                    <td class="FormLineItemAlt" style="width: 10%">
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="FormLineItemAlt" style="width: 10%">
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="FormLineItemAlt" style="width: 10%">
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="FormLineItemAlt" style="width: 10%">
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="FormLineItemAlt" style="width: 10%">
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="FormLineItemAlt" style="width: 10%">
                                        &nbsp;</td>
                                </tr>

                            </table>
                        </td>
                    </tr>
                </table>
                <table border="0" width="100%">
                    <tr>
                        <td>
                            <asp:Button ID="btn_Cancel" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                Height="30px" OnClientClick="return Main.cancelDialogClick()" Text="Close" Width="90px" />
                            <asp:Button ID="btn_Filter0" runat="server" BackColor="#1B7FC2" ForeColor="#FFFFFF"
                                Height="30px" Text="Filter" Width="90px" onclick="btn_Filter_Click"/>
                            <asp:Button ID="btn_Generate" runat="server" BackColor="#1B7FC2" 
                                ForeColor="#FFFFFF" Height="30px" onclick="btn_Generate_Click" Text="Generate" 
                                Width="90px" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="lb_Message" runat="server" Text="All Approved WSCs:" Font-Bold="True"></asp:Label>
                        </td>
                    </tr>
                </table>
                
                <div style="height: 490px; overflow: scroll">
                    <table style="width: 100%; border: 1px;" cellpadding="3" cellspacing="0">
                        <tr>
                            <td colspan="2" style="text-align: center;">
                                <asp:GridView ID="grdItem" runat="server" CssClass="GridInner" Width="100%" BorderColor="White"
                                    BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                                    HeaderStyle-Height="27px">
                                    <RowStyle BackColor="#D9E0ED" ForeColor="Black" BorderColor="White" BorderWidth="2px"
                                        Height="25px" />
                                    <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" Height="25px" />
                                    <Columns>
                                        
                                        <asp:TemplateField HeaderText="Submit">
                                            <ItemStyle HorizontalAlign="Center" Width="15px" />
                                            <HeaderTemplate>
                                                <%--<asp:CheckBox ID="chkheader" runat="server" onclick="CheckAll(this)" />--%>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkChild" runat="server" Visible='true' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="ID" SortExpression="ItemCode">
                                            <ItemStyle HorizontalAlign="left" Width="25px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbGeneralID" runat="server" Text='<%# Bind("GeneralID") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Type">
                                            <ItemStyle HorizontalAlign="Left" Width="30px" />
                                            <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbType" runat="server" Text='<%# Bind("WSCType") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Dealer Code" SortExpression="ItemCode">
                                            <ItemStyle HorizontalAlign="left" Width="50px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbDealerCode" runat="server" Text='<%# Bind("DealerCode") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Dealer Name" SortExpression="ItemCode">
                                            <ItemStyle HorizontalAlign="left" Width="180px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbDealerName" runat="server" Text='<%# Bind("DealerName") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Service Date">
                                            <ItemStyle HorizontalAlign="Left" Width="60px" />
                                            <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbDate" runat="server" Text='<%# Bind("ServiceDate","{0:dd/MM/yyyy}") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="VIN" SortExpression="ItemName">
                                            <ItemStyle HorizontalAlign="left" Width="140px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbVIN" runat="server" Text='<%# Bind("VIN") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Customer" SortExpression="InStock">
                                            <ItemStyle HorizontalAlign="left" Width="150px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbCustomerName" runat="server" Text='<%# Bind("CustomerName") %>'
                                                    BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Sequence No.">
                                            <ItemStyle HorizontalAlign="Left" />
                                            <HeaderStyle VerticalAlign="Middle" Width="80px" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbSeqNo" Style="text-align: left" runat="server" Text='<%# Bind("SeqNo") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Condition Code">
                                            <ItemStyle HorizontalAlign="Left" />
                                            <HeaderStyle VerticalAlign="Middle" Width="100px" />
                                            <ItemTemplate>
                                                <asp:Label ID="lbCondCode" Style="text-align: left" runat="server" Text='<%# Bind("ConditionCode") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
                                    <SelectedRowStyle BackColor="#9471DE" Font-Bold="true" ForeColor="White" />
                                    <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False"
                                        Height="27px" VerticalAlign="Bottom" />
                                    <EmptyDataTemplate>
                                        No Data Found.
                                    </EmptyDataTemplate>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: center;">
                            </td>
                        </tr>
                    </table>
                </div>

            </ContentTemplate>
            <Triggers>
                <%-- <asp:PostBackTrigger  ControlID="btnFilter" />--%>
                <%--  <asp:PostBackTrigger  ControlID="txtFilter" />--%>
            </Triggers>
        </asp:UpdatePanel>
    </div>
</asp:Content>
<asp:Content ID="Content3" runat="server" contentplaceholderid="head">
    <style type="text/css">

* { margin: 2px 0 0 0; 
padding: 0; }
    </style>
</asp:Content>

